package com.zxy.salenet.web.web.controller;

import com.zxy.salenet.web.pojo.vo.HomeVO;
import com.zxy.salenet.web.service.UserHomeService;
import com.zxy.salenet.web.utils.Json;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zxy
 * @version: 1.0
 * @description:    用户首页数据显示
 */
    /**
 * UserHomeController
 */
@Api(value = "用户首页数据获取API",tags = "用户首页数据获取API")
@RestController
@RequestMapping("/UserHome")
public class UserHomeController {
    @Autowired
    private UserHomeService userHomeService;
    /**
     * 获取首页需要的数据
     * @return
     */
    @ApiOperation(value = "用户获取首页需要展示的数据",notes = "直接向后端进行请求")
    @ApiImplicitParam(name="Json",value = "",dataType = "Json",required = false)
    @PostMapping("/Home")
    private Json queryHomeDate(){
        Json json = new Json();
         HomeVO homeVO = userHomeService.queryHomeAllMessage();
        json.setCode(200);
        json.setData(homeVO);
        json.setMessage("查询成功");
        return json;
    }
}
